package com.ruoyi.shop.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.FavoritesMapper;
import com.ruoyi.shop.domain.Favorites;
import com.ruoyi.shop.service.IFavoritesService;

/**
 * 收藏Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-20
 */
@Service
public class FavoritesServiceImpl implements IFavoritesService 
{
    @Autowired
    private FavoritesMapper favoritesMapper;

    /**
     * 查询收藏
     * 
     * @param fId 收藏主键
     * @return 收藏
     */
    @Override
    public Favorites selectFavoritesByFId(Long fId)
    {
        return favoritesMapper.selectFavoritesByFId(fId);
    }

    /**
     * 查询收藏列表
     * 
     * @param favorites 收藏
     * @return 收藏
     */
    @Override
    public List<Favorites> selectFavoritesList(Favorites favorites)
    {
        return favoritesMapper.selectFavoritesList(favorites);
    }

    /**
     * 新增收藏
     * 
     * @param favorites 收藏
     * @return 结果
     */
    @Override
    public int insertFavorites(Favorites favorites)
    {
        return favoritesMapper.insertFavorites(favorites);
    }

    /**
     * 修改收藏
     * 
     * @param favorites 收藏
     * @return 结果
     */
    @Override
    public int updateFavorites(Favorites favorites)
    {
        return favoritesMapper.updateFavorites(favorites);
    }

    /**
     * 批量删除收藏
     * 
     * @param fIds 需要删除的收藏主键
     * @return 结果
     */
    @Override
    public int deleteFavoritesByFIds(Long[] fIds)
    {
        return favoritesMapper.deleteFavoritesByFIds(fIds);
    }

    /**
     * 删除收藏信息
     * 
     * @param fId 收藏主键
     * @return 结果
     */
    @Override
    public int deleteFavoritesByFId(Long fId)
    {
        return favoritesMapper.deleteFavoritesByFId(fId);
    }
}
